package com.example.ecs.core;

import java.util.ArrayList;
import java.util.List;

/**
 * System类是所有系统的基类
 * 系统包含逻辑但不包含数据
 */
public abstract class System {
    protected List<Entity> entities;
    
    public System() {
        this.entities = new ArrayList<>();
    }
    
    public void addEntity(Entity entity) {
        if (!entities.contains(entity)) {
            entities.add(entity);
        }
    }
    
    public void removeEntity(Entity entity) {
        entities.remove(entity);
    }
    
    public List<Entity> getEntities() {
        return entities;
    }
    
    // 系统更新方法，由游戏循环调用
    public abstract void update(double deltaTime);
}